<dev xmlns="http://www.w3.org/1999/xhtml"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:p="http://primefaces.org/ui">
    <c:set var="root" value="#{request.contextPath}" />

    <ui:composition template="../template/common.xhtml" >
        <ui:define name="topComponents">
            <c:set var="activeItem" value="productPage"/>
            <ui:include src="../navigator.xhtml" />
        </ui:define>
        <ui:define name="content">
            <div class="span12">
                <div class="well"> 
                    <h:form id="usersForm">
                        <p:dataTable var="prc" value="#{priceBrowseCtrl.dataModel}" selectionMode="single" selection="#{priceBrowseCtrl.selected}" paginator="true" rows="10" lazy="true"
                                     rowKey="#{prc.id}" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}" >
                            <p:column headerText="Id" sortBy="#{prc.id}" filterBy="#{prc.id}">
                                <h:outputText value="#{prc.id}" />
                            </p:column>
                            <p:column headerText="Apply Time" sortBy="#{prc.applyDateTime}" >
                                <!--filterBy="#{prc.applyDateTime}"-->  
                                <h:outputText value="#{prc.applyDateTime}">
                                    <f:convertDateTime type="date" pattern="dd-MM-yyyy"/>
                                </h:outputText>
                            </p:column>
                            <p:column headerText="value" sortBy="#{prc.val}" filterBy="#{prc.val}" filterMatchMode="contains">
                                <h:outputText value="#{prc.val}" >
                                    <f:convertNumber />
                                </h:outputText>
                            </p:column>
                            <p:column headerText="unit" sortBy="#{prc.unit}" filterBy="#{prc.unit}" filterMatchMode="contains">
                                <h:outputText value="#{prc.unit}" />
                            </p:column>
                        </p:dataTable>
                        <p:commandButton value="Create" action="#{priceBrowseCtrl.goToPriceCreate()}" />
                        <p:commandButton value="Edit" action="#{priceBrowseCtrl.goToEditPage()}"/>
                        <p:commandButton value="Delete" action="#{priceBrowseCtrl.delete()}" ajax="false" />
                    </h:form>
                </div>
            </div>
        </ui:define>
    </ui:composition>
</dev>